<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/html5.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="__PUBLIC__/Admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新增图片</title>
</head>
<body>
<div class="pd-20">
	<form action="__URL__/addImageGroup" method="post" class="form form-horizontal" id="form-article-add" enctype="multipart/form-data">
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>：群组名称</label>
			<div class="formControls col-10">
                 <if condition="$data['id'] neq ''">
                       <input type="hidden" name="id" value="{$data['id']}">
                 </if>
				<input type="text" class="input-text" value="{$data['cname']}" placeholder="" id="" name="grouname">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">简略标题：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text" value="{$data['cname']}" placeholder="" id="" name="group-title">
			</div>
		</div>
        <div class="row cl">
            <label class="form-label col-2">展现样式：</label>
            <div class="formControls col-10" id="form_radio">
                 <div class="formControls_radios" onclick="formRadio(this,0)">
                     <if condition="$data['style'] eq 1">
                         <i class="bg" style="transform:scale(1,1)"></i>
                         <b>瀑布流</b>
                         <input type="radio" name="group-style" checked value="1">
                      <else />
                         <i class="bg" style="transform:scale(0.5,0.5)"></i>
                         <b>瀑布流</b>
                         <input type="radio" name="group-style" value="1">
                      </if>
                 </div>
                <div class="formControls_radios" onclick="formRadio(this,1)">
                    <if condition="$data['style'] eq 2">
                            <i class="bg1" style="transform:scale(1,1)"></i>
                            <b>画册</b>
                            <input type="radio" name="group-style" checked value="2">
                        <else />
                        <i class="bg1"></i>
                        <b>画册</b>
                        <input type="radio" name="group-style" value="2">
                    </if>
                </div>
                <div class="formControls_radios" onclick="formRadio(this,2)">
                    <if condition="$data['style'] eq 3">
                    <i class="bg2" style="transform:scale(1,1)"></i>
                    <b>幻灯片</b>
                    <input type="radio" name="group-style" checked value="3">
                        <else/>
                        <i class="bg2"></i>
                        <b>幻灯片</b>
                        <input type="radio" name="group-style" value="3">
                    </if>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-2">相册封面：</label>
            <div class="formControls col-10">
                   <div class="photo_cover">
                        <div class="photo_view">
                             <if condition="$data['cover'] neq ''">
                                 <img src="/{$data['cover']}" alt="">
                             </if>
                        </div>
                        <div class="photo_upload_btn">
                             上传封面
                            <input type="file" name="file" onchange="selectFile(this)">
                        </div>
                   </div>
            </div>
        </div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>相册群组：</label>
			<div class="formControls col-2"> <span class="select-box">
				<select name="group_pid" class="select">
					<option value="0">全部栏目</option>
					{$cate}
				</select>
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">关键词：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text" value="{$data['key_word']}" placeholder="" id="" name="group_keyword">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">相册简介：</label>
			<div class="formControls col-10">
				<textarea name="group_intro" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" onKeyUp="textarealength(this,200)">{$data['intro']}</textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
			</div>
		</div>
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>
				<button onClick="article_save();" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存草稿</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
</div>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/1.9.3/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/H-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/baseCommon.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/H-ui.admin.js"></script>
<script type="text/javascript">
    /**
     * 自定义单选按钮
     * @param obj
     */
     function formRadio(obj,index){
           var Radio_box = document.getElementById('form_radio');
           var Radio = Radio_box.getElementsByTagName('input');
           var ispan = Radio_box.getElementsByTagName('i');
           console.log(ispan.length);
           for(var i=0; i<ispan.length;i++){
                  ispan[i].style.transform = 'scale(0.5,0.5)';
                  Radio[i].checked = false;
           }
           ispan[index].style.transform = 'scale(1,1)';
           Radio[index].checked = true;
    }

    //上传图片预览
    function selectFile(obj){
         var file = '';
         var value = obj.value;
         if(is_allowType(subfix(value))){
              file = value;
              var photo_view =document.getElementsByClassName("photo_view")[0];
              preview(obj,photo_view);
         }else{
              alert('请上传图片文件');
              obj.value = file;
         }
    }
</script>
</body>
</html>